<template>
  <z-paging ref="paging" v-model="dataList" @query="queryList">
    <view w-full box-border pa-20rpx @click="$navigateTo('/pages/exam/errorPaper')">
      <view v-for="item in dataList" bg-white rounded-20rpx box-border px-20rpx py-40rpx mb-20rpx>
        <view text-28rpx font-500 break-all mb-40rpx>{{ item.title }}</view>
        <view text-24rpx text="#7D7D7D">答题时间：{{ item.createTime }}</view>
      </view>
    </view>
  </z-paging>
</template>

<script setup lang="ts">
import { selectErrorQuestionList } from '@/api/examRecord'
import { onLoad, onShow } from '@dcloudio/uni-app'
const paging = ref<any>(null)
const dataList = ref<any>([])

const queryList = (pageNo: number, pageSize: number) => {
  selectErrorQuestionList({
    pageNumber: pageNo,
    pageSize: pageSize
  })
    .then((res: any) => {
      paging.value.complete(res.data.result.records)
    })
    .catch((res) => {
      paging.value.complete(false)
    })
}

onMounted(() => {})
onLoad((options: any) => {})
onShow(() => {
  paging.value.reload()
})
</script>
<style>
page {
}
</style>
<style scoped lang="scss"></style>
